<template>
    <link type="text/css" rel="stylesheet" href="/assets/css/style.css">
    <link rel="stylesheet" href="/assets/css/info.css">

    <section class="aui-flexView">
        <!-- 订单详细 -->
        <section class="aui-scrollView">
            <!-- 订单状态 -->
            <div class="aui-pay-change">
                <div class="aui-flex">
                    <div class="aui-flex-box">
                        <h3>物流详情</h3>
                    </div>
                    <div class="aui-pay-zfb">
                        <img src="/assets/images/icon-zfb.png" alt="" />
                    </div>
                </div>
            </div>

            <!-- 收货地址 -->
            <van-contact-card type="edit" :name="`${address.consignee} ${address.region_text}`" :tel="address.mobile" v-if="address" :editable="false" />

            <!-- 物流信息 -->
            <van-steps direction="vertical" :active="0">
                <van-step>
                    <h3>【广州市】您的快递已签收，签收人在【保安室】暂存。如有疑问请联系业务员：13845937283。感谢使用中通快递，期待再次为您服务！</h3>
                    <p>2024-07-13 12:40</p>
                </van-step>
                <van-step>
                    <h3>【广州市】广州鹭江财智大厦的业务员【李四，13845937283】正在为您派件</h3>
                    <p>2024-07-13 10:00</p>
                </van-step>
                <van-step>
                    <h3>【广州市】快件已发往 鹭江财智大厦</h3>
                    <p>2024-07-12 19:30</p>
                </van-step>
                <van-step>
                    <h3>【广州市】快件已到达 广州装运中心</h3>
                    <p>2024-07-12 12:40</p>
                </van-step>
                <van-step>
                    <h3>【重庆市】快件已发往 广州转运中心</h3>
                    <p>2024-07-10 12:00</p>
                </van-step>
                <van-step>
                    <h3>【重庆市】快件已发货</h3>
                    <p>2024-07-10 09:30</p>
                </van-step>
            </van-steps>
        </section>
    </section>

</template>

<script setup>
    const { proxy } = getCurrentInstance()

    let orderid = proxy.$route.query.orderid ? proxy.$route.query.orderid : 0
    let address = ref(null)

    onBeforeMount(() => {
        OrderData()
    })

    const OrderData = async () => 
    {
        var params = {
            orderid: orderid,
            busid: proxy.$business.value.id
        }

        var result = await proxy.$POST({
            url: '/order/info',
            params
        })

        if (result.code == 0) {
            proxy.$fail(result.msg)
            return false
        }

        address.value = result.data.address

    }
</script>